local skill = fk.CreateSkill{
  name = "action__yinglang_skill",
}

Fk:loadTranslationTable{
  ["action__yinglang"] = "鹰狼",
  ["action__yinglang_skill"] = "鹰狼",
  [":action__yinglang"] = "锦囊牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：你 <br /><b>效果</b>：本轮内所有角色使用牌指定其他角色为目标后，先获得目标一张牌。（不可响应）",
  ["#action__yinglang_skill"] = "令本轮内所有角色使用牌指定其他角色为目标后，先获得目标一张牌",
  ["@@action__yinglang-round"] = "鹰狼",
}


skill:addEffect("cardskill", {
  mute = true,
  name = "action__yinglang",
  prompt = "#action__yinglang_skill",
  mod_target_filter = Util.TrueFunc,
  can_use = function(self, player, card)
    return not player:isProhibited(player, card)
  end,
  on_use = function(self, room, cardUseEvent)
    cardUseEvent.disresponsiveList = table.simpleClone(Fk:currentRoom().players)
    if not cardUseEvent.tos or #cardUseEvent.tos == 0 then
      cardUseEvent.tos = { cardUseEvent.from }
    end
  end,
  on_effect = function(self, room, effect)
    for _, p in ipairs(room:getAlivePlayers()) do
      room:setPlayerMark(p, "@@action__yinglang-round", 1)
    end
  end,
})

skill:addEffect(fk.TargetSpecified, {
  mute = true,
  global = true,
  is_delay_effect = true,
  can_trigger = function(self, event, target, player, data)
    local cards = data.to:getCardIds({Player.Hand, Player.Equip})
    return target == player and player:getMark("@@action__yinglang-round") ~= 0 and #cards > 0
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local cards = data.to:getCardIds({Player.Hand, Player.Equip})
    if #cards == 0 then return false end
    if data.to ~= data.from then
      local card = room:askToChooseCard(data.from, {
        target = data.to,
        flag = "he",
        skill_name = self.name,
      })
      room:obtainCard(data.from, card, false, fk.ReasonPrey, data.from)
    end
  end,
})


return skill